/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package register.ucm;
import register.model.ButtonModel;
import register.model.InputValueModel;
import register.view.RegisterPanel;
import javax.swing.*;

/**
 *
 * @author Vitamin
 */

public class GeneralSwitch {
    
    private ButtonModel button;
    private InputValueModel value;
    private JComboBox group;
    private SwitchToDefault init;
    private SwitchToStudent student;
    private SwitchToStaff staff;
    private SwitchToTeacher teacher;

    public GeneralSwitch()
    {
        button=RegisterPanel.getInstance().getButtonModel();
        value=RegisterPanel.getInstance().getInputValueModel();
    }

    public void componentSwitch()
    {
        if(value.getGroup().equals("- click to select -"))
        {
            init=new SwitchToDefault(button,value);
            init.toDefault();

        }else if(value.getGroup().equals("Student"))
        {
            student=new SwitchToStudent(button,value);
            student.toStudent();

        }else if(value.getGroup().equals("Teacher"))
        {
            teacher=new SwitchToTeacher(button,value);
            teacher.toTeacher();

        }else if(value.getGroup().equals("Staff"))
        {
            staff=new SwitchToStaff(button,value);
            staff.toStaff();

        }
    }

}
